package com.itheima.d5_recursion;

import java.io.File;

/*
    目标：掌握文件删除
 */
public class RecursionTest3 {
    public static void main(String[] args) {
        File file = new File("E:/text");
        del(file);
    }

    public static void del(File a) {
        File[] files = a.listFiles();
        for (File file : files) {
            if (file.isFile()) {
                file.delete();
            } else {
                del(file);
            }
        }
        a.delete();
    }
}









